function checkAddNav() {
	var fm = document.add;
	if(fm.name.value == '') {
		alert('导航条不能为空!');
		fm.name.focus();
		return false;
	}
	if(fm.name.value.length < 2) {
        alert('导航条不能少于两位!');
        fm.name.focus();
        return false;
    }
    if(fm.name.value.length > 5) {
        alert('导航条不能大于五位!');
        fm.name.focus();
        return false;
    }
    if(fm.info.value.length > 200) {
    	alert('导航简介不能大于两百位!');
        fm.info.focus();
        return false;
    }
	return true;	
}
function checkUpdateNav() {
	var fm = document.update;
	if(fm.info.value.length > 200) {
        alert('导航简介不能大于两百位!');
        fm.info.focus();
        return false;
    }
	return true;
}
function ajaxCheckNav() {
    var name = document.add.name;
    var warning = document.getElementById('warning');
    warning.style.display = 'none';
    ajax({
        'method':'post',
        'async':true,
        'url':'?a=nav&m=checkNavName',
        'data': {
            'name':name.value
        },
        success : function(text) {
            if(text == 1) {             
                warning.style.display = 'block';
            }
        }   
    });
}